home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / videoutils / a-g / ami2d / test / srm3.rexx < prev    next >
OS/2 REXX Batch file  |  1978-11-24  |  1KB  |  77 lines

  1. /* simple solid rocket motor */
  2. options results
  3.  
  4. if ~show('ports', "AMI2D") then do
  5.     address command 'run ami2d:bin/ami2d'
  6.     do while ~show('ports', "AMI2D")
  7.     end
  8. end
  9.  
  10. address ami2d
  11.  
  12. call 'ami2d:rexx/pstrain'
  13.  
  14. if ~show('l', "rexxmathlib.library") then do
  15.     check = addlib('rexxmathlib.library',0,-30,0)
  16. end
  17.  
  18. pi = 3.141592654
  19. nn = 16
  20. mn = 8
  21. ne = nn/2 - 1
  22. me = mn/2 - 1
  23. b = 6.0
  24. a = 1.0
  25. h = 0.05
  26. E = 1500.0
  27. nu = 0.4900
  28. Ec = 10.0e6
  29. nuc = 0.3000
  30. P = -1000.0
  31.  
  32. 'reset'
  33. 'iso(1,'E','nu')'
  34. 'iso(2,'Ec','nuc')'
  35. g = 1.5
  36. do i=0 to nn
  37.     do j=0 to mn
  38.         k = i*40 + j + 1
  39.         r = a + (b-a)*pow(i/nn,g)
  40.         t = j*pi/(2.0*mn)
  41.         x1 = r*sin(t)
  42.         y1 = r*cos(t)
  43.         'node('k','x1','y1')'
  44.     end
  45. end
  46. do i=1 to 2
  47.     do j=0 to mn
  48.         k = (nn + i)*40 + j + 1
  49.         r = b + i*h/2
  50.         t = j*pi/(2.0*mn)
  51.         x1 = r*sin(t)
  52.         y1 = r*cos(t)
  53.         'node('k','x1','y1')'
  54.     end
  55. end
  56. do i=0 to ne
  57.     do j=0 to me
  58.         k = i*20 + j + 1
  59.         n = i*80 + j*2 + 1
  60.         'quad8('k',1,'n','n + 2','n + 82','n + 80','n + 1','n + 42','n + 81','n + 40')'
  61.     end
  62. end
  63. i = ne + 1
  64. do j=0 to me
  65.     k = i*20 + j + 1
  66.     n = i*80 + j*2 + 1
  67.     'quad8('k',2,'n','n + 2','n + 82','n + 80','n + 1','n + 42','n + 81','n + 40')'
  68. end
  69. do i=0 to (nn + 2)
  70.     'dispx('i*40 + 1',0.0)'
  71.     'dispy('i*40 + mn + 1',0.0)'
  72. end
  73. do i=0 to me
  74.     'press('i + 1',0,'P')'
  75. end
  76. exit
  77.